package model;

import static org.junit.Assert.*;

import org.junit.Test;

/**
 * Tests the Database class.
 * 
 * @author Rylie Nelson
 */

public class DatabaseTest {

	@Test
	public void testParse() {
		Database db = new Database();
		
		//ensures the user list is of correct size
		assertEquals("wrong user count faggot", 237, db.getUsers().size());
		
		//ensures the conference list is of correct size
		assertEquals("wrong conf count faggot", 4, db.getConferences().size());
		
		//ensures an arbitrary user was imported correctly
		assertTrue("doesn't have that person dumbass", 
				db.getUsers().contains(new User("Bonita.Ficke@safeway.com", 71, "Bonita", "Ficke")));
		
	}
	
	@Test
	public void testImportPapers() {
		Database db = new Database();
	
		assertEquals("wrong person dingus", "CHensley@safeco.com", 
				db.getConferences().get(0).getPapers().get(0).getAuthor());
		assertEquals("wrong person stupid jackass", "John.Harris@gapinc.com", 
				db.getConferences().get(1).getPapers().get(0).getAuthor());
	}

}
